package com.njbw.book.facade.facade;

/**
 * 外观类
 * 它需要了解所有的子系统的方法或属性，进行组合，以备外部调用
 *
 * @author 黄侯淳
 * @since JDK 1.8
 */
public class Facade {

    private final SubSystemOne subSystemOne;
    private final SubSystemTwo subSystemTwo;
    private final SubSystemThree subSystemThree;
    private final SubSystemFour subSystemFour;

    public Facade() {
        this.subSystemOne = new SubSystemOne();
        this.subSystemTwo = new SubSystemTwo();
        this.subSystemThree = new SubSystemThree();
        this.subSystemFour = new SubSystemFour();
    }

    public void methodA() {
        System.out.println("方法组 A() ----");
        this.subSystemOne.methodOne();
        this.subSystemTwo.methodTwo();
        this.subSystemFour.methodFour();
    }

    public void methodB() {
        System.out.println("方法组 B() ----");
        this.subSystemTwo.methodTwo();
        this.subSystemThree.methodThree();
    }
}
